package com.mirror.repository;

import com.mirror.entity.oldman.Employees;
import com.mirror.entity.oldman.SchedulingProgram;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EmployeesRepository extends JpaRepository<Employees, String>, JpaSpecificationExecutor<Employees> {


    Page<Employees> findAllByIsdel(Pageable pageable,boolean isdel);

    Page<Employees> findAllByNameLikeAndIsdel(Pageable pageable, String name,boolean isdel);

    List<Employees> findAllByIsdel(boolean isdel);

    List<Employees> findAllByIsMonitorAndIsdel(boolean isMonitor,boolean isdel);

    List<Employees> findAllByNameLikeOrNumLikeAndIsdel(String name, String num,boolean isdel);

    List<Employees> findAllBySchProgramAndIsdel(SchedulingProgram Sching,boolean isdel);

    Employees findAllByNumAndIsdel(String um,boolean isdel);

    Employees findAllByPhone(String phone);

    List<Employees> findAllBySchProgramIsNull();
}
